home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / editors / TurboText / Rexx / DiceHelp.ttx next >
Encoding:
Text File  |  1995-12-24  |  1.7 KB  |  74 lines

  1. /*
  2. **      $Id: DiceHelp.ttx,v 30.0 1994/06/10 18:06:16 dice Exp $
  3. **
  4. **      DICEHelp help system.  Script for Oxxi TurboText (tm).
  5. **
  6. **      Rexx script modeled after version by David Joiner
  7. */
  8. PARSE UPPER ARG COMMAND  /* PROMPT */
  9.  
  10. OPTIONS RESULTS
  11.  
  12. IF COMMAND = "PROMPT" THEN
  13.    'RequestStr prompt "Enter search string  "'
  14. ELSE
  15.    'GETLINE'
  16. if (RC > 0) then exit
  17. searchline = RESULT
  18.  
  19. IF COMMAND = "" THEN
  20. DO
  21.    'GETCURSORPOS'
  22.    searchcol = word(RESULT, 4)
  23. END
  24.  
  25. hostname = address()            /* Source TTX window */
  26. portname = 'DICEHELP'           /* DICEHelp's port name */
  27. tempname = 't:DICEHelp.temp'    /* Temporary file for passing clips */
  28.  
  29. if ~show('p',portname) then do
  30.     address COMMAND 'RUN >NIL: <NIL: DICEHelp REXXSTARTUP'
  31.  
  32.     do i = 1 to 6
  33.         if ~show('p',portname) then do
  34.             address COMMAND 'wait 1'
  35.         end
  36.     end
  37.  
  38.     if ~show('p',portname) then do
  39.         'SetStatusBar "DICEHelp program not found!"'
  40.             exit
  41.     end
  42. end
  43.  
  44. address value portname
  45. IF COMMAND = "PROMPT" THEN
  46.    'T' searchline        /* Search for searchline, return <T>empfile */
  47. ELSE
  48.    'Z' searchcol searchline     /* Search for string: Z xx line */
  49. if RC=0 then do
  50.     refline   = RESULT
  51.         refstring = SUBWORD( refline, 2 )
  52.  
  53.     address value hostname           /* Back to TTX */
  54.         if WORD( refline, 1 ) = "E" then do
  55.                 'SetStatusBar' refstring
  56.                 exit
  57.     end
  58.  
  59.         OPENDOC NAME refstring
  60.     newport = RESULT        /* get the new editor's port name */
  61.     if RC > 0 then do        /* if not there, then error       */
  62.             'SetStatusBar' "Error opening" refstring
  63.         exit
  64.     end
  65.         address value newport           /* Address the new window */
  66.         SETREADONLY
  67.  
  68.     exit
  69. end
  70. else do
  71.     address value hostname
  72.     'SetStatusBar' "Error code" RC "DICEHelp failed!"
  73. end
  74.